package com.example.demo.controller;

import com.example.demo.dto.MbtiSubmitDTO;
import com.example.demo.service.TestRecordService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/mbti")
@CrossOrigin
public class TestRecordController {

    @Autowired
    private TestRecordService testRecordService;

    @Operation(summary = "新增测试记录")
    @PostMapping("/record")
    public String saveTestRecord(@RequestBody MbtiSubmitDTO dto) {
        testRecordService.saveTestRecord(dto);
        return "测试记录保存成功";
    }
}
